homework

Homework#

Your homework for Arrays session is to write a calculator function that takes at least three parameters and does some mathematical operations:#

function calculator([num, op, num, op, num,]) {
// Your Code goes here
};
calculator([2, '+' , 4]); // 2 + 4 = 6
calculator([2, '+', 4, '-', 1, '*', 3 ]) // 2 + 4 - (1 * 3) = 3

Feel free to rename the function and parameters as you like.#